package com.ruoyi.shop.goods.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.goods.mapper.ShopGoodsSkuMapper;
import com.ruoyi.shop.goods.domain.ShopGoodsSku;
import com.ruoyi.shop.goods.service.IShopGoodsSkuService;
import com.ruoyi.shop.goods.vo.ShopGoodsSkuVo;

/**
 * 商品sku信息Service业务层处理
 * 
 * @author xuxiang
 * @date 2023-04-21
 */
@Service
public class ShopGoodsSkuServiceImpl implements IShopGoodsSkuService {
	@Autowired
	private ShopGoodsSkuMapper shopGoodsSkuMapper;

	/**
	 * 查询商品sku信息
	 * 
	 * @param skuId 商品sku信息主键
	 * @return 商品sku信息
	 */
	@Override
	public ShopGoodsSkuVo selectSkuById(Long skuId) {
		return shopGoodsSkuMapper.selectSkuById(skuId);
	}

	/**
	 * 查询商品sku信息列表
	 * 
	 * @param shopGoodsSku 商品sku信息
	 * @return 商品sku信息
	 */
	@Override
	public List<ShopGoodsSku> selectSkuList(ShopGoodsSku shopGoodsSku) {
		return shopGoodsSkuMapper.selectSkuList(shopGoodsSku);
	}

	/**
	 * 新增商品sku信息
	 * 
	 * @param shopGoodsSku 商品sku信息
	 * @return 结果
	 */
	@Override
	public int insertGoodsSku(ShopGoodsSku shopGoodsSku) {
		return shopGoodsSkuMapper.insertGoodsSku(shopGoodsSku);
	}

	/**
	 * 修改商品sku信息
	 * 
	 * @param shopGoodsSku 商品sku信息
	 * @return 结果
	 */
	@Override
	public int updateGoodsSku(ShopGoodsSku shopGoodsSku) {
		return shopGoodsSkuMapper.updateGoodsSku(shopGoodsSku);
	}

	/**
	 * 根据商品id删除sku信息
	 * 
	 * @param goodsId
	 * @return
	 */
	@Override
	public int deleteByGoodsId(Long goodsId) {
		return shopGoodsSkuMapper.deleteByGoodsId(goodsId);
	}

	/**
	 * 删除商品sku信息信息
	 * 
	 * @param skuId 商品sku信息主键
	 * @return 结果
	 */
	@Override
	public int deleteSkuById(Long skuId) {
		return shopGoodsSkuMapper.deleteSkuById(skuId);
	}
}
